import {Component} from 'react'

class Son extends Component{
    render(){
        let {count, msg} = this.props;
        return <div>
            <h3>Son</h3>
            <p>Son props count: {count}</p>
            <p>Son props msg: {msg}</p>
            <p><button onClick={()=>{
                this.props.count = 100; // 报错：props.count是只读属性，不能修改
            }}>count++</button></p>

            <p><button onClick={()=>{
                // 子组件传递参数给父组件
                
            }}>非要改,就必须改数据源</button></p>
        </div>
    }
}
export default Son;